
/* JavaScript content from js/road-condition.js in folder common */
(function($){
	$(".backBtn").on('tap', function() {
		$.mobile.changePage("driver-main.html");
	});
	var script = document.createElement('script');
	script.type = 'text/javascript';
//	if(window.page == 0) {
//		script.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyAuBWJtxkiuJGQ_IpfGxJJFAnoLSE59DVo&sensor=false&'
//			+ 'callback=initialize&language=zh-CN&&libraries=places';
//	}else {
//		script.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyAuBWJtxkiuJGQ_IpfGxJJFAnoLSE59DVo&sensor=false&'
//			+ 'callback=initialize&language=zh-CN&libraries=geometry';
//	}
//	script.src = "http://maps.google.com/maps/api/js?sensor=false";
//	document.body.appendChild(script);
	var head=document.getElementsByTagName('head');
	
	//<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
	$('<link>').attr({
		href:"http://code.google.com/apis/maps/documentation/javascript/examples/default.css",
		type:"text/css",
		rel: "stylesheet",
	}).appendTo("head");
	initializePage();
	//initialize(31.2072103, 121.58700499999998);
})(jQuery);


function initializePage(){
	//alert('road condition');
	
}

function initialize(latitude, longitude) {
	 // var myLatlng = new google.maps.LatLng(latitude, longitude);
	 var myLatlng = new google.maps.LatLng(31.2072103,  121.58700499999998);
	  var myOptions = {
	    zoom: 13,
	    center: myLatlng,
	    mapTypeId: google.maps.MapTypeId.ROADMAP
	  };

	  var map = new google.maps.Map(document.getElementById("roadCondition"), myOptions);

	  var trafficLayer = new google.maps.TrafficLayer();
	  trafficLayer.setMap(map);
	}